<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>首页</title>
    <style type="text/css">
        table {border-collapse: collapse; font-size: 14px; width: 80%; margin: auto;}
        table, th, td {border: 1px solid darkslategray;padding: 10px}
    </style>
</head>
<body>
<div style="text-align: center">
    <a th:href="@{/login/toLogin}">退出登录</a>
    <span style="color: darkslategray; font-size: 30px">欢迎<span th:text="${session.login.loginName}"></span>使用！</span>
    <hr/>

    <table class="list">
        <tr>
            <form th:action="@{/user/findList(user=(${user}))}" method="post">
                <th>员工姓名</th>
                <th><input type="text" name="uname" th:value="${user.uname}"></th>
                <!--
                只能查看本部门
                <th>员工部门</th>
                <th>
                    <select name="eid" class="form-control">
                        <option value="">部门</option>
                        <option th:selected="user.eid eq emp.eid"
                                th:each="emp:${empList}"
                                th:value="${emp.eid}"
                                th:text="${emp.ename}">
                        </option>
                    </select>
                </th>
                -->
                <th><input type="submit" value="查询"></th>
            </form>
        </tr>
        <tr>
            <td>姓名</td>
            <td>性别</td>
            <td>出生日期</td>
            <td>入职时间</td>
            <td>学历</td>
            <td>职务</td>
            <td>住址</td>
            <td>电话</td>
            <td>紧急联系人</td>
            <td>所属部门</td>
        </tr>
        <tr th:each="user : ${userList}">
            <td th:text="${user.uname}"></td>
            <td th:text="(${user.sex}==1)?'男':'女'"></td>
            <td th:text="${#dates.format(user.birthday,'yyyy-MM-dd')}"></td>
            <td th:text="${#dates.format(user.joinTime,'yyyy-MM-dd')}"></td>
            <td th:text="${user.education}"></td>
            <td th:text="${user.jid}"></td>
            <td th:text="${user.address}"></td>
            <td th:text="${user.phone}"></td>
            <td th:text="${user.ecPerson}"></td>
            <td th:text="${user.eid}"></td>
        </tr>
    </table>
</div>
</body>
</html>